﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using NHibernate;
using FluentNHibernate.Data;

namespace BankCreditPortfolio.DAL.Entities
{
    public class Client//Persistence
    {
        public virtual int ClientId { get; set; }
        public virtual Account Account { get; set; }
        public virtual Profile Profile { get; set; }
        //public virtual OrderInfoPersistence Order { get; set; }
    }

    //public class Client : ClientPersistence
    //{
    //    new public OrderInfo Order
    //    {
    //        get { return (OrderInfo) base.Order; }
    //        set { base.Order = value; }
    //    }
    //}

    public class ClientMap : ClassMap<Client>//Persistence>
    {
        public ClientMap()
        {
            Id(x => x.ClientId).GeneratedBy.HiLo("client");
            Id(x => x.ClientId).Unique();
            References(x => x.Account).Column("AccountId");
            References(x => x.Profile).Column("ProfileId");
            //References(x => x.Order).Column("OrderId");
            Table("Client");
        }
    }
}
